<?php

namespace App\Console\Commands;

use App\Services\ProxyService;
use Illuminate\Console\Command;

class FlowConsumeDetail extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:getFlowConsumeDetail {date?}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '流量消费详情查询';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle(ProxyService $proxyService)
    {
        $date = $this->argument('date') ?? date('Y-m-d');
        $proxyService->getFlowConsumeDetail($date);
        return true;
    }
}
